package Day05;

import javax.management.relation.RelationNotFoundException;
import java.util.Random;
import java.util.Scanner;

public class Demo7 {
    public static void main(String[] args) {
         bl();
        bll(bl());
    }
    public static int[] bl(){
        int[] arr=new int[6];
        Random r=new Random();
        for (int i = 0; i < arr.length; i++) {
            while (true){
                int num=r.nextInt(9)+1;
            if(!array(num,arr)){
                arr[i]=num;
                break;
            }
            }
        }
        return arr;
    }
    public static boolean array(int num,int[] arr){
        for (int i = 0; i <arr.length ; i++) {
            if(num==arr[i]){
                return true;
            }
        }
        return false;
    }
    public static void bll(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}

